<html>
<head>
    <title>Title</title>
    <link rel="stylesheet" th:href="@{/css/plugins/layui/css/layui.css}">
</head>
<body>
<div class="layui-form">
    <div class="layui-form-item">
        <div class="layui-inline">
            <label class="layui-form-label">学号</label>
            <div class="layui-input-inline layui-input-wrap">
                <input type="text" id="studentNum" name="studentNum" class="layui-input">
            </div>
        </div>
    </div>
    <div class="layui-form-item">
        <div class="layui-inline">
            <label class="layui-form-label">学生姓名</label>
            <div class="layui-input-inline layui-input-wrap">
                <input type="text" id="studentName" name="studentName" class="layui-input">
            </div>
        </div>
    </div>
    <div class="layui-form-item">
        <div class="layui-inline">
            <input type="hidden" id="gender" name="gender">
            <label class="layui-form-label">性别</label>
            <div class="layui-input-inline layui-input-wrap">
                <input type="radio" name="gender" value="0" title="男"lay-filter="gender">
                <input type="radio" name="gender" value="1" title="女"lay-filter="gender">
                <input type="radio" name="gender" value="2" title="保密"lay-filter="gender">
            </div>
        </div>
    </div>

    <div class="layui-form-item">
        <div class="layui-inline">
            <label class="layui-form-label">年龄</label>
            <div class="layui-input-inline layui-input-wrap">
                <input type="text" id="age" name="age" class="layui-input">
            </div>
        </div>
    </div>
    <div class="layui-form-item">
        <div class="layui-inline">
            <label class="layui-form-label">生日</label>
            <div class="layui-input-inline layui-input-wrap">
                <input type="text" id="birthday" name="birthday" class="layui-input">
            </div>
        </div>
    </div>
    <div class="layui-form-item">
        <div class="layui-inline">
            <label class="layui-form-label">班级</label>
            <div class="layui-input-inline layui-input-wrap">
                <select name="classId" id="classId" th:with="clas=${@classService.list()}">
                    <option>请选择</option>
                    <option th:each="cla:${clas}" th:text="${cla.className}" th:value="${cla.classId}"></option>
                </select>
            </div>
        </div>
    </div>
    <div class="layui-form-item">
        <div class="layui-inline">
            <label class="layui-form-label">宿舍号</label>
            <div class="layui-input-inline layui-input-wrap">
                <select name="hotelId" id="hotelId" th:with="hotels=${@hotelService.list()}">
                    <option>请选择</option>
                    <option th:each="hotel:${hotels}" th:text="${hotel.hotelName}" th:value="${hotel.hotelId}"></option>
                </select>
            </div>
        </div>
    </div>
    <div class="layui-form-item">
        <div class="layui-inline">
            <label class="layui-form-label">电话</label>
            <div class="layui-input-inline layui-input-wrap">
                <input type="text" id="phone" name="phone" class="layui-input">
            </div>
        </div>
    </div>
    <div class="layui-form-item">
        <div class="layui-inline">
            <label class="layui-form-label">邮箱</label>
            <div class="layui-input-inline layui-input-wrap">
                <input type="text" id="email" name="email" class="layui-input">
            </div>
        </div>
    </div>
    <div class="layui-form-item">
        <div class="layui-inline">
            <label class="layui-form-label">地址</label>
            <div class="layui-input-inline layui-input-wrap">
                <input type="text" id="homeAddress" name="homeAddress" class="layui-input">
            </div>
        </div>
    </div>
    <div class="layui-form-item">
        <div class="layui-inline">
            <label class="layui-form-label">紧急联系人</label>
            <div class="layui-input-inline layui-input-wrap">
                <input type="text" id="emergencyContact" name="emergencyContact" class="layui-input">
            </div>
        </div>
    </div>
    <div class="layui-form-item">
        <div class="layui-inline">
            <label class="layui-form-label">紧急联系人电话</label>
            <div class="layui-input-inline layui-input-wrap">
                <input type="text" id="emergencyContactPhone" name="emergencyContactPhone" class="layui-input">
            </div>
        </div>
    </div>
    <div class="layui-form-item">
        <div class="layui-inline">
            <label class="layui-form-label">专业</label>
            <div class="layui-input-inline layui-input-wrap">
                <select name="majorId" id="majorId" th:with="majors=${@majorService.list()}">
                    <option>请选择</option>
                    <option th:each="major:${majors}" th:text="${major.majorName}" th:value="${major.majorId}"></option>
                </select>
            </div>
        </div>
    </div>
    <div class="layui-form-item">
        <div class="layui-inline">
            <input type="hidden" id="status" name="gender">
            <label class="layui-form-label">学生状态</label>
            <div class="layui-input-inline layui-input-wrap">
                <input type="radio" name="status" value="0" title="在读"lay-filter="status" >
                <input type="radio" name="status" value="1" title="毕业"lay-filter="status">
            </div>
        </div>
    </div>
    <div class="layui-form-item">
        <div class="layui-inline">
            <label class="layui-form-label">备注</label>
            <div class="layui-input-inline layui-input-wrap">
                <input type="text" id="remark" name="remark" class="layui-input">
            </div>
        </div>
    </div>
    <div class="layui-form-item">
        <div class="layui-inline">
            <label class="layui-form-label">创建者</label>
            <div class="layui-input-inline layui-input-wrap">
                <input type="text" id="createBy" name="createBy" class="layui-input">
            </div>
        </div>
    </div>
</div>
<script th:src="@{/js/plugins/layui/layui.js}"></script>
<script th:src="@{/js/jquery.min.js}"></script>
<script>
    layui.use(function(){
        var laydate=layui.laydate;
        var form = layui.form;
        var $=layui.$;
        var layer=layui.layer;
        laydate.render({
            elem:'#birthday'
            ,type:'date'
        })
        form.on('radio(gender)', function(data){
            $('#gender').val(data.value);
        })
        form.on('radio(status)', function(data){
            $('#status').val(data.value);
        })
    })
</script>
</body>
</html>
